<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../lib/react.js"></script>
  <script src="../lib/react-dom.js"></script>
  <script src="http://cdn.bootcss.com/babel-core/5.8.38/browser.min.js"></script>
</head>
<body>
  <div id="app"></div>

  <script type="text/babel">
    let Mycomponent = React.createClass({
      getInitialState() {
        return {
          value: "请输入..."
        }
      },
      handleChange() {
        // let val = this.refs.myInput.value;
        let val = ReactDOM.findDOMNode(this.refs.myInput).value;
        console.log(val)
      },
      render() {
        return (
          <div>
              <input type="text" defaultValue="hello" ref="myInput" onChange={this.handleChange} />
          </div>
        )
      }
    })

    ReactDOM.render(
      <Mycomponent />,
      document.querySelector("#app")
    )
  </script>
</body>
</html>